<?php

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
require 'dbcon.php';
$email=$_REQUEST['email'];
$slug=$_REQUEST['slug'];
$nickname=$_REQUEST['nickname'];
$password=$_REQUEST['password'];
$sql="insert into users(email,slug,nickname,password) values('{$email}','{$slug}','{$nickname}','{$password}')";
$rs=$db->query($sql);//$rs 返回值  如果成功，返回true 如果失败，返回false
$db->close();//关闭数据库连接
if ($rs==true)
{
    header("Location:isusers.php");
}
 else {
   echo '<script type="text/javascript">'; 
   echo 'alert("添加用户失败");';
   echo 'window.location.href="isusers.php";';
   echo '</script>';
}

